<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-3.3.1.min.js"></script>
    <style>
        @keyframes yaoyiyao {
            0%{
                transform: rotate(60deg);
            }
            100%{
                transform: rotate(-60deg);
            }
        }
        .shou{
            width: 100px;
            height:300px;
            background:red;
            margin:200px;
            transform-origin: 50% 100% 0px;
        }
        .ani{
            animation: yaoyiyao 800ms infinite  linear alternate;

        }
    </style>
</head>
<body>
<div class="shou"></div>
<button type="button">点击查看动画</button>
<script>
    $('button').click(function(){
        $('.shou').toggleClass('ani');
            });
</script>
</body>
</html>